﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using NET4.Database;
using System.Data.Linq;
using NET4.Database.Repository;

namespace NET4.Programma
{
  public partial class Main : Form
  {
    public Main()
    {
      InitializeComponent();
    }

    #region Protected methods
    protected void OverviewSupplier()
    {
      OverviewSupplier overviewSupplier = new OverviewSupplier();
      overviewSupplier.MdiParent = this;
      overviewSupplier.Show();
    }

    protected void AddSupplier()
    {
      DetailSupplier detailSupplier = new DetailSupplier();
      detailSupplier.ShowDialog();
    }

    protected void OverviewOfferRequest()
    {
      OverviewOfferRequest overviewOfferRequest = new OverviewOfferRequest();
      overviewOfferRequest.MdiParent = this;
      overviewOfferRequest.Show();
    }

    protected void AddOfferRequest()
    {
      DetailOfferRequest detailOfferRequest = new DetailOfferRequest();
      detailOfferRequest.ShowDialog();
    }
    #endregion

    #region EventHandlers
    private void tsmiFileSettings_Click(object sender, EventArgs e)
    {
      Settings settings = new Settings();
      settings.ShowDialog();
    }

    private void tsmiFileClose_Click(object sender, EventArgs e)
    {
      Application.Exit();
    }

    private void tsmiSupplierOverview_Click(object sender, EventArgs e)
    {
      this.OverviewSupplier();
    }
    
    private void tsmiSupplierAdd_Click(object sender, EventArgs e)
    {
      this.AddSupplier();
    }

    private void tsmiOfferRequestOverview_Click(object sender, EventArgs e)
    {
      this.OverviewOfferRequest();
    }

    private void tsmiOfferRequestAdd_Click(object sender, EventArgs e)
    {
      this.AddOfferRequest();
    }
    #endregion
  }
}
